<script setup>
import {useI18n} from 'vue-i18n'

const i18n = useI18n()
console.log(i18n)

function handleLanguage(item) {
  i18n.locale.value = item
}
</script>

<template>
  <div>
    <el-button @click="handleLanguage('zh')">切换中文</el-button>
    <el-button @click="handleLanguage('en')">切换英文</el-button>
    {{ $t('msg.text') }}
  </div>
</template>

<style scoped>

</style>